<%-- 
    Document   : rightpannel
    Created on : Nov 19, 2012, 4:28:36 PM
    Author     : BlueS
--%>


<%@page import="java.util.Calendar"%>
<div class="rightpannel" >
    <%
        HttpSession ses = request.getSession();
        String fullURI = request.getRequestURI();
        if (ses.getAttribute("user") == null) {
            response.sendRedirect("../index.jsp");
        }
    %>

    <h2><%=ses.getAttribute("user")%>
        <a href="../index.jsp?logout=out"><img height="10" width="10" src="../Image/x.png"></a></h2>
    <form action="<%=fullURI%>" method="GET">
        <table>
            <tr>
                <td>Year: </td>
                <td><select name="year">
                        <% int year = Calendar.getInstance().get(Calendar.YEAR);
                            year -= 50;
                            for (int j = 0; j < 100; j++) {
                                if ((year + j) == Calendar.getInstance().get(Calendar.YEAR)) {
                                    out.print("<option selected='selected'>" + (year + j) + "</option>");
                                } else {
                                    out.print("<option>" + (year + j) + "</option>");
                                }

                            }
                        %>
                    </select></td>
            </tr>
            <tr>
                <td>Month: </td>
                <td><select name="month">
                        <% for (int j = 0; j < 12; j++) {
                                if ((j + 1) == (Calendar.getInstance().get(Calendar.MONTH)+1)) {
                                    out.print("<option selected='selected'>" + (j + 1) + "</option>");
                                } else {
                                    out.print("<option>" + (j + 1) + "</option>");
                                }

                            }
                        %>
                    </select>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" class="butt_search" value="Search"></td>
            </tr>
        </table>
    </form>


</div>
